home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{C22877C0-4214-11D0-B0DA-080009C351D7}#1.0#0"; "FtpTree.ocx"
- Begin VB.Form Form1
- Caption = "FtpTree ActiveX Control VB Sample"
- ClientHeight = 6810
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 7935
- Icon = "SamplesForm1.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 6810
- ScaleWidth = 7935
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton FindFiles
- Caption = "&Find Files..."
- Height = 375
- Left = 5880
- TabIndex = 15
- Top = 5880
- Width = 1575
- End
- Begin VB.CommandButton CompareFolders
- Caption = "Synchronize..."
- Height = 375
- Left = 5880
- TabIndex = 14
- Top = 5400
- Width = 1575
- End
- Begin VB.CommandButton NewDir
- Caption = "&New Folder..."
- Height = 375
- Left = 5880
- TabIndex = 13
- Top = 4920
- Width = 1575
- End
- Begin VB.CommandButton Remove
- Caption = "&Remove"
- Height = 375
- Left = 5880
- TabIndex = 11
- Top = 4440
- Width = 1575
- End
- Begin VB.CommandButton Open
- Caption = "&Open"
- Height = 375
- Left = 5880
- TabIndex = 10
- Top = 3960
- Width = 1575
- End
- Begin VB.CommandButton View
- Caption = "&View"
- Height = 375
- Left = 5880
- TabIndex = 9
- Top = 3480
- Width = 1575
- End
- Begin VB.CommandButton Get
- Caption = "&Get"
- Height = 375
- Left = 5880
- TabIndex = 8
- Top = 3000
- Width = 1575
- End
- Begin VB.TextBox Password
- Height = 375
- IMEMode = 3 'DISABLE
- Left = 5880
- PasswordChar = "*"
- TabIndex = 3
- Text = "sales@rhinosoft.com"
- Top = 1920
- Width = 1815
- End
- Begin VB.TextBox UserID
- Height = 405
- Left = 5880
- TabIndex = 2
- Text = "anonymous"
- Top = 1200
- Width = 1815
- End
- Begin VB.TextBox Site
- Height = 375
- Left = 5880
- TabIndex = 1
- Text = "ftp.microsoft.com"
- Top = 480
- Width = 1815
- End
- Begin VB.CommandButton Connect
- Caption = "&Connect"
- Height = 375
- Left = 5880
- TabIndex = 7
- Top = 2520
- Width = 1575
- End
- Begin VB.Frame Frame1
- Caption = "FTP Site"
- Height = 6495
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5535
- Begin FTPTREELib.FtpTree FtpTree1
- Height = 5895
- Left = 240
- TabIndex = 12
- Top = 360
- Width = 5055
- _Version = 65536
- _ExtentX = 8916
- _ExtentY = 10398
- _StockProps = 228
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- Appearance = 1
- TrackSelect = -1 'True
- AllowPut = -1 'True
- AllowRemove = -1 'True
- AllowCreateDir = -1 'True
- AllowRemoveDir = -1 'True
- ShowFtpSite = -1 'True
- AllowEditLables = -1 'True
- DodEntry = ""
- DodUserID = ""
- DodPassword = ""
- DodDomain = ""
- DodCallBackNumber= ""
- End
- End
- Begin VB.Label PasswordLabel
- Caption = "&Password:"
- Height = 255
- Left = 5880
- TabIndex = 6
- Top = 1680
- Width = 1815
- End
- Begin VB.Label Label1
- Caption = "&User ID:"
- Height = 255
- Index = 0
- Left = 5880
- TabIndex = 5
- Top = 960
- Width = 1695
- End
- Begin VB.Label SiteLabel1
- Caption = "&Site:"
- Height = 255
- Index = 1
- Left = 5880
- TabIndex = 4
- Top = 240
- Width = 1215
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub CompareFolders_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- Item.RunSynchronizeFoldersDialog
- End If
- End Sub
- Private Sub FindFiles_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- If (Item.IsDirectory) Then
- Path = Item.Path
- Else
- Path = Item.Parent.Path
- End If
-
- FtpTree1.RunFindFileDialog (Path)
- End If
- End Sub
- Private Sub Form_Load()
- Dim StrArr(1 To 10) As String
- FtpTree1.AllowEditLabels = True
- StrArr(1) = ".htm,C:\Program Files\Microsoft FrontPage\bin\fpeditor.exe"
- FtpTree1.AlternateEditors = StrArr
- FtpTree1.UploadNewerOnly = True
- End Sub
- Private Sub FtpTree1_DownloadRequest(ByVal DestDir As String, ByVal SourceFiles As Variant)
- ' uncomment the following line to cancel the request
- ' FtpTree1.Abort
- End Sub
- Private Sub FtpTree1_FileAdded(ByVal FtpTreeItem As FTPTREELib.FtpTreeItem)
- MsgBox FtpTreeItem.filename
- End Sub
- Private Sub FtpTree1_UploadRequest(ByVal DestinationItem As FTPTREELib.FtpTreeItem, ByVal SourceFiles As Variant)
- ' uncomment the following line to cancel the request
- ' FtpTree1.Abort
- End Sub
- Private Sub Get_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- Item.Get
- End If
- End Sub
- Private Sub Connect_Click()
- FtpTree1.ShowFtpSite = True
- FtpTree1.NewSession Site, "", UserID, Password
- End Sub
- Private Sub NewDir_Click()
- ' make sure we have an item selected first
- If Not Form1.FtpTree1.SelItem Is Nothing Then
-
- ' do the NewFolder dialog
- NewFolder.Show
- Else
- MsgBox "Please select a parent folder before using this option.", , "FtpTree ActiveX Control VB Sample"
- End If
- End Sub
- Private Sub Open_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- Item.Open
- End If
- End Sub
- Private Sub Remove_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- If MsgBox("Are you sure you want to remove: " + Item.filename, vbYesNo, "FtpTree Sample") = vbYes Then
- Item.Delete
- End If
- End If
- End Sub
- Private Sub View_Click()
- Dim Item As FtpTreeItem
- Set Item = FtpTree1.GetSelectedItem
- If Not Item Is Nothing Then
- Item.View
- End If
- End Sub
-